package com.itheima.staticAgent;

public class ZhongjieAgent implements Star{
    private Star actor;
    private String before;//舞台前置工作
    private String after;//后置工作
    //通过构造方法给真实类赋值


    public ZhongjieAgent(Star actor, String before, String after) {
        this.actor = actor;
        this.before = before;
        this.after = after;
    }

    public void sing() {
        //被代理了 要开始增强了
        System.out.println("唱歌前的准备工作"+before);
        //真实的类方法
        this.actor.sing();

        System.out.println("清场 收钱"+after);
    }
}
